package com.hy.demo.ui.toolbar;

import android.view.View;
import android.view.ViewGroup;

import androidx.core.app.ActivityCompat;

import com.hy.demo.R;
import com.hy.demo.widget.ToolbarUI;
import com.hy.frame.base.BaseActivity;
import com.hy.frame.util.LogUtil;


public class ToolbarActivity extends BaseActivity {

    @Override
    protected void initLayout() {
        setContentView(R.layout.v_toolbar);
        new ToolbarUI(getContext(), new Runnable() {
            @Override
            public void run() {
                onBackPressed();
            }
        }).setTranslucentStatus(true).build(getSupportActionBar()).setTitle("测试").setLeftIcon(R.mipmap.ic_back);
    }

    @Override
    protected void initView() {
//        ActivityCompat.
        findViewById(R.id.textView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LogUtil.d("onClick");
                ((ViewGroup)v.getParent().getParent().getParent()).getChildAt(2).setFitsSystemWindows(false);
            }
        });
    }

    @Override
    protected void initData() {

    }
}
